package com.edgar.redis;

import java.util.HashMap;

/**
 * @author liqs
 * @version 1.0
 * @date 2021/6/16 11:06
 * 使用 HashMap 做缓存（缺点，一旦出问题就需要重新开始）
 */
public class HashMapCache {

    private String datasetname;
    private HashMap<String, String> stringStringHashMap;

    public HashMapCache(String datasetname) {
        this.datasetname = datasetname;
        // 每一个数据集对应一个 HashMap
        stringStringHashMap = new HashMap<>();
    }

    public void setRecord(String key, String value) {
        stringStringHashMap.put(key, value);
    }

    public HashMap<String, String> getStringStringHashMap() {
        return stringStringHashMap;
    }

    public String getDatasetname() {
        return datasetname;
    }

    public void setDatasetname(String datasetname) {
        this.datasetname = datasetname;
    }
}
